<template>
  <div class="dashboard-editor-container">
    <el-card class="box-card">
      <div slot="header" class="clearfix">
        <span>{{name}}</span>
        <el-button style="float: right; padding: 3px 0" type="text"></el-button>
      </div>

      <el-form label-position="left" inline class="demo-table-expand">
        <el-form-item label="店铺头像:" label-width="200px">
          <el-avatar src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"></el-avatar>
        </el-form-item>
        <el-form-item label="店铺网址：">
          <span>{{ data.web }}</span>
        </el-form-item>
        <el-form-item label="店铺地址：">
          <span>{{ data.addr }}</span>
        </el-form-item>
        <el-form-item label="店铺电话：">
          <span>{{ data.phone }}</span>
        </el-form-item>
        <el-form-item label="店铺简介：">
          <span>{{ data.note }}</span>
        </el-form-item>
      </el-form>
    </el-card>
  </div>
</template>

<script>
import { mapGetters, mapState } from "vuex";
import {getsupolierById} from "@/api/zjm_Foods"
import Axios from "axios";
export default {
  name: "DashboardEditor",
  data() {
    return {
      data: {}
    };
  },
  computed: {
    ...mapGetters(["name", "avatar", "roles"]),
    ...mapState("user", ["_id"])
  },
  created() {
    Axios({
      url: "/api/admin/getAdminById",
      method: "get",
      params: {
        _id: this._id
      }
    }).then(res => {
      const { data } = res;
      if (data.status != 1) {
        this.$router.replace("/showSupplier");
      }
    });
    getsupolierById(this._id).then(res => {
      this.data = res.data;
    });
    
  }
};
</script>

<style lang="scss" scoped>
.emptyGif {
  display: block;
  width: 45%;
  margin: 0 auto;
}

.dashboard-editor-container {
  height: 100%;
  padding: 50px 60px 0px;
  .pan-info-roles {
    font-size: 12px;
    font-weight: 700;
    color: #333;
    display: block;
  }
  .info-container {
    position: relative;
    margin-left: 190px;
    height: 150px;
    line-height: 200px;
    .display_name {
      font-size: 48px;
      line-height: 48px;
      color: #212121;
      position: absolute;
      top: 25px;
    }
  }
}
</style>
<style  scoped>
.text {
  font-size: 14px;
}

.item {
  margin-bottom: 18px;
}
.clearfix:before,
.clearfix:after {
  display: table;
  content: "";
}
.clearfix:after {
  clear: both;
}

.box-card {
  width: 480px;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.img {
  width: 300px;
}
</style>
